@extends('layouts.app')
@section('title','APP引导页管理')
@section('content')
<!-- start: Content -->
<div class="row-fluid">		
	<div class="box span12">
		<div class="box-header" data-original-title="">
			<h2><span class="break"></span>APP页面管理</h2>
			<h2 style='color:black;'><span class="break"></span>注：比例为1：1.775，大小为375*667、750*1334，1500*2668（参考），图片格式可为JPG，PNG</h2>
		</div>
		<form action="{{ URL('app/m/update') }}" id='btn_1' method='POST' enctype="multipart/form-data">
			{{ csrf_field() }}
		<div class="box-content">
			<a class="span2 btn">
				<span>启动页</span>
				<img src="/images/border_bootom.png" alt="">
				<img src="/images/app_1.jpg" alt="" style='width:201px;height:358px;'>
			</a>
			<a class="span2 btn" style='margin-left:150px;'>
				<span>引导页-1</span>
				<img src="/images/border_bootom.png" alt="">
				@if(count($img) >= 1)
					<img src="{{ $img[0]->path }}" alt="" style='width:201px;height:358px;'>
				@endif
				<p class='btn btn-primary' style='margin: 20px 0px;display:;' id='app_11' onclick='app_1()'>更换</p>
				<p id='targetFrame_1' style='margin: 20px 0px;display: none;'>
					<input type="file" id='file_1' name='filename1'>
					<button type="submit" class='btn btn-primary' onclick='btn_1(this)'>确定</button>
				</p>	
			</a>
			<a class="span2 btn">
				<span>引导页-2</span>
				<img src="/images/border_bootom.png" alt="">
				@if(count($img) >= 2)
					<img src="{{ $img[1]->path }}" alt="" style='width:201px;height:358px;'>
				@endif
				<p class='btn btn-primary' style='margin: 20px 0px;' id='app_22' onclick='app_2()'>更换</p>
				<p id='targetFrame_2' style='margin: 20px 0px;display: none;'>
					<input type="file" id='file_2' name='filename2'>
					<button type="submit" class='btn btn-primary' onclick='btn_1(this)'>确定</button>
				</p>	
			</a>
			<a class="span2 btn">
				<span>引导页-3</span>
				<img src="/images/border_bootom.png" alt="">
				@if(count($img) >= 3)
					<img src="{{ $img[2]->path }}" alt="" style='width:201px;height:358px;'>
				@endif
				<p class='btn btn-primary' style='margin: 20px 0px;' id='app_33' onclick='app_3()'>更换</p>
				<p id='targetFrame_3' style='margin: 20px 0px;display: none;'>
					<input type="file" id='file_3' name='filename3'>
					<button type="submit" class='btn btn-primary' onclick='btn_1(this)'>确定</button>
				</p>	
			</a>
			<div class="clearfix"></div>
		</div>
		</form>
	</div><!--/span-->

</div><!--/row-->
<script>
	
	function app_1(o){
		document.getElementById("app_11").style.display='none'; 
		document.getElementById("targetFrame_1").style.display=''; 
		document.getElementById("file_1").click(); 

    }

	function app_2(o){
		document.getElementById("app_22").style.display='none'; 
		document.getElementById("targetFrame_2").style.display=''; 
		document.getElementById("file_2").click(); 
	}

	function app_3(o){
		document.getElementById("app_33").style.display='none'; 
		document.getElementById("targetFrame_3").style.display=''; 
		document.getElementById("file_3").click(); 
	}
	function btn(o){
		document.getElementById("targetFrame_1").style.display='none'; 
		document.getElementById("targetFrame_2").style.display='none'; 
		document.getElementById("targetFrame_3").style.display='none'; 
		document.getElementById("app_11").style.display=''; 
		document.getElementById("app_22").style.display=''; 
		document.getElementById("app_33").style.display=''; 
	}
</script>
<!-- end: Content -->
@stop